﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Galaxy.AutoCAD.Tests;

namespace Galaxy.AutoCAD.Tests
{
    public static class ArcTools
    {
        public static void CreateArc(this Arc arc, Point3d startPoint, Point3d pointOnArc, Point3d endPoint)
        {
            CircularArc3d geArc = new CircularArc3d(startPoint, pointOnArc, endPoint);
            Point3d centerPoint = geArc.Center;
            arc.Center = centerPoint;
            arc.Radius = geArc.Radius;
            arc.StartAngle = startPoint.AngleFromAxis(centerPoint);
            arc.EndAngle = endPoint.AngleFromAxis(centerPoint);
        }
    }
}
